def check_strength(password: str) -> str:
    pwd = {}
    for char in password:
        if char.isupper():
            pwd['upper'] = pwd.get('upper', 0) + 1
        elif char.islower():
            pwd['lower'] = pwd.get('lower', 0) + 1
        elif char.isnumeric():
            pwd['num'] = pwd.get('num', 0) + 1
        elif char in '!@#$%^&*':
            pwd['special'] = pwd.get('special', 0) + 1
    level = 0
    if len(password) >= 8:
        level += 1
    for key in pwd:
        if key in ['num', 'special']:
            level += 1
        else:
            level += 0.5
    if level < 2:
        return 'weak'
    elif level < 4:
        return 'medium'      
    else:
        return 'strong'